<template>
	<div class="bg">
		<uni-nav-bar :fixed="true" title="信息登记" background-color="#5C7FF5" status-bar :dark="true" left-icon="left">

		</uni-nav-bar>

		<div>
			<div class="p30 bgwhite">
				<div class="infoItem">
					<div class="infoItem_label">运营单位</div>
					<div class="infoItem_content">{{ form.org }}</div>
				</div>
				<div class="infoItem">
					<div class="infoItem_label">所属电站</div>
					<div class="infoItem_content">{{ form.station }}</div>
				</div>
				<div class="infoItem noboderbottom">
					<div class="infoItem_label">电压等级</div>
					<div class="infoItem_content">{{ form.voltage }}</div>
				</div>

			</div>
			<div class="line"></div>
			<div class="p30 bgwhite">
				<div class="infoItem">
					<div class="infoItem_label">设备名称</div>
					<div class="infoItem_content">{{ form.deviceName }}</div>
				</div>
				<div class="infoItem">
					<div class="infoItem_label">设备类型</div>
					<div class="infoItem_content">{{ form.deviceType }}</div>
				</div>
				<div class="infoItem">
					<div class="infoItem_label">缺陷部位</div>
					<div class="infoItem_content">{{ form.partsType }}</div>
				</div>
				<div class="infoItem">
					<div class="infoItem_label">缺陷描述</div>
					<div class="infoItem_content quexian_word">{{ form.description }}</div>
				</div>
				<div class="infoItem">
					<div class="infoItem_label">分类依据</div>
					<div class="infoItem_content">{{ form.classificationBasis }}</div>
				</div>
				<div class="infoItem">
					<div class="infoItem_label">缺陷性质</div>
					<div class="infoItem_content">{{ form.level }}</div>
				</div>
				<div class="infoItem">
					<div class="infoItem_label">缺陷发现人员</div>
					<div class="infoItem_content">{{ form.username }}</div>
				</div>
				<div class="infoItem noboderbottom">
					<div class="infoItem_label">巡检时间</div>
					<div class="infoItem_content">{{ form.time }}</div>
				</div>
			</div>
			<div class="line"></div>
			<div class="p50 bgwhite" style="margin-top: 16rpx;">
				<uni-file-picker limit="1" multiple @success="success" @progress="progress" @fail="fail"
					:disabled="true" @select="select" v-model="fileLists">
					<img src="../../static/img/isAdd.png" style="width: 72rpx;height: 60rpx;" alt="">

				</uni-file-picker>
			</div>
			<div class="addBtn">
				<div class="bts edit" @click="toright">
					消缺
				</div>

			</div>

		</div>
	</div>
</template>

<script>
	import {
		COM_URL,
		IMG_URL
	} from "@/utils/config";
	import {
		findDefectByCode
	} from '@/utils/http'
	export default {




		data() {
			return {
				form: {},
				fileLists: []
			};
		},
		onLoad(query) {
			console.log(query, 'query')
			this.getInfo(query.id)
		},
		methods: {
			// 消缺
			toright() {
				uni.navigateTo({
					url: '/pages/order/xiaoqueright?code=' + this.form.code
				})
			},
			getInfo(code) {
				findDefectByCode({
					code
				}).then(res => {
					console.log(res, 'res')
					this.form = res.result
					if (this.form.pic.length > 0) {
						this.form.pic.forEach(item => {
							this.fileLists.push({
									url: IMG_URL + item.path,
									code: item.code,
									id: item.id,
									fileID: item.code,
									path: item.path,
									paths: item.paths,
								}

							)
						})
					}
				})
			},

		}

	};
</script>

<style scoped lang="scss">
	.bg {
		box-sizing: border-box;
		// padding:0rpx 50rpx;
		// height: 100vh;
		background: #F5F6F8;

		.noboderbottom {
			border-bottom: none !important;
		}

		.infoItem {
			padding: 20rpx 0;
			display: flex;
			justify-content: space-around;
			border-bottom: 1rpx solid #b1aeae;

			.infoItem_label {
				width: 200rpx;
				font-family: Source Han Sans CN, Source Han Sans CN;
				font-weight: 500;
				font-size: 28rpx;
			}

			.infoItem_content {
				margin-left: 80rpx;
				flex-wrap: wrap;
				flex: 1;
				font-family: Source Han Sans CN, Source Han Sans CN;
				font-weight: 400;
				font-size: 28rpx;
				color: #262626;
			}
		}

		.line {
			height: 16rpx;
		}
	}

	.pImg {
		margin-top: 20rpx;
		width: 298rpx;
		height: 212rpx;
	}

	.hasFlex {
		display: flex;
		justify-content: space-between;
		flex-wrap: wrap;
	}

	.addBtn {
		margin-top: 30rpx;
		padding-bottom: 30rpx;
		line-height: 80rpx;

		.bts {
			text-align: center;
			width: 650rpx;
			height: 80rpx;
			margin: 0 auto;
			box-shadow: 0rpx 3rpx 6rpx 1rpx rgba(0, 0, 0, 0.16);
			border-radius: 12rpx 12rpx 12rpx 12rpx;
			font-family: Source Han Sans CN, Source Han Sans CN;
			font-weight: 500;
			font-size: 36rpx;

		}

		.edit {
			background: #5C7FF5;
			color: #FFFFFF;
		}

		.del {
			background: #FFFFFF;
			box-shadow: 0rpx 3rpx 6rpx 1rpx rgba(0, 0, 0, 0.16);
			border-radius: 12rpx 12rpx 12rpx 12rpx;
			border: 1rpx solid #707070;
			font-family: Source Han Sans CN, Source Han Sans CN;
			font-weight: 500;
			font-size: 36rpx;
			color: #2B2B2B;
		}
	}
</style>
<style scoped>
	.p30 {
		padding: 20rpx 30rpx;

	}

	.p50 {
		padding: 20rpx 50rpx;

	}

	.bgwhite {
		background: white;
		box-shadow: 0rpx 3rpx 6rpx 1rpx rgba(0, 0, 0, 0.16);
	}

	.bg>>>.uni-nav-bar-text {
		font-size: 35rpx;
	}

	.bg>>>.icon-del-box {
		display: none !important;
		width: 40rpx;
		height: 40rpx;
		background-color: red;

	}

	.bg>>>.icon-del {
		width: 20rpx;
		height: 4rpx;
	}
</style>